package com.quanyan.authority.model.request;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.NotBlank;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/7/28.
 */
public class ReqBaseParam extends ReqPage{
    private static final long serialVersionUID = 4818472531402550403L;

    private Integer id;
    /**
     * 名称
     */
    @NotBlank(message = "name不能为空！")
    private String name;

    /**
     * 编码
     */
    @NotBlank(message = "code不能为空！")
    private String code;

    /**
     * 备注
     */
    private String remark="";


    private Integer founder;

    private Integer isDelete = 0;

    private String founderName;


    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public Integer getFounder() {
        return founder;
    }

    public void setFounder(Integer founder) {
        this.founder = founder;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFounderName() {
        return founderName;
    }

    public void setFounderName(String founderName) {
        this.founderName = founderName;
    }

    @Override
    public String toString() {
        return "ReqBaseParam{" +
                "name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", remark='" + remark + '\'' +
                ", founder=" + founder +
                '}';
    }

    public Map<String,Object> toMap(){
        Map<String,Object> map = new HashMap<String,Object>();
        if(id !=null)
            map.put("id",id);

        if(StringUtils.isNotBlank(name))
            map.put("name",name);

        if(StringUtils.isNotBlank(code))
            map.put("code",code);

        if(StringUtils.isNotBlank(remark))
            map.put("remark",remark);

        if(isDelete != null)
            map.put("isDelete",isDelete);

        return  map;

    }
}
